import { keyData } from "./../store/index";
import { TypeData } from "@/store";

export function titleText(text: string): string {
	//return text.slice(0, 1).toUpperCase() + text.slice(1).toLowerCase();
	return text.toLowerCase();
}

export function getTransText(arr: TypeData) {
	const result: {
		avatar: string;
		data: string[];
	}[] = [];

	keyData.forEach((keyName) => {
		if (arr[keyName] && Array.isArray(arr[keyName])) {
			result.push({
				avatar: keyName,
				data: arr[keyName]!,
			});
		}
	});

	return result;
}
